package com.lx.oms.controller.manager.impl;

import java.math.BigInteger;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.lx.oms.common.entity.Page;
import com.lx.oms.common.entity.Query;
import com.lx.oms.common.utils.Utils;
import com.lx.oms.controller.dao.QuotationAnalysisMapper;
import com.lx.oms.controller.entity.QuotationAnalysisEntity;
import com.lx.oms.controller.manager.QuotationAnalysisManager;

/**
 * 行情分析
 *
 * @author houzhong
 * @date 2018年7月19日 上午11:16:01
 */
@Component("quotationAnalysisManager")
public class QuotationAnalysisManagerImpl implements QuotationAnalysisManager {

	@Autowired
	private QuotationAnalysisMapper quotationAnalysisMapper;
	

	@Override
	public List<QuotationAnalysisEntity> listQuotationAnalysis(Page<QuotationAnalysisEntity> page, Query search) {
		return quotationAnalysisMapper.listForPage(page, search);
	}

	@Override
	public int saveQuotationAnalysis(QuotationAnalysisEntity quotationAnalysis) {
		if (quotationAnalysis.getId() == null) {
			quotationAnalysis.setId(Utils.id().toString());
		}
		return quotationAnalysisMapper.save(quotationAnalysis);
	}

	@Override
	public QuotationAnalysisEntity getQuotationAnalysisById(BigInteger id) {
		QuotationAnalysisEntity quotationAnalysis = quotationAnalysisMapper.getObjectById(id);
		return quotationAnalysis;
	}

	@Override
	public int updateQuotationAnalysis(QuotationAnalysisEntity quotationAnalysis) {
		return quotationAnalysisMapper.update(quotationAnalysis);
	}

	@Override
	public int batchRemove(String[] id) {
		int count = quotationAnalysisMapper.batchRemove(id);
		return count;
	}
	
}
